<?php

namespace App\Http\Controllers\Common;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Gregwar\Captcha\CaptchaBuilder;

class Captch extends Controller
{
    public function showCaptch() {

    	$builder = new CaptchaBuilder;
		$builder->build();
		//获取到显示的验证码存入session中
		session(['Captch' => $builder->getPhrase()]);
		//输出到页面
		header('Content-type: image/jpeg');
		$builder->output();
    }
}
